package javaDemo01;

import java.util.ArrayList;

public class ShoppingCart {
    public ArrayList<Goods> goodslist = new ArrayList<>();

    public void add(Goods a) {
        goodslist.add(a);
    }
    public void show(){
        for (int i = 0; i < goodslist.size(); i++) {
            Goods a = goodslist.get(i);
            System.out.println(a.getName());
            System.out.println(a.getId());
            System.out.println(a.getPrice());
        }
    }
}
